#include <stdio.h>

int main()
{
	int a,b;
	for (a = 1, b = 1; b <= 20; b++)
	{
		if (a > 10)
			break;
		if (a % 2 == 1)
		{
			a += 5;
			continue;
		}
		a -= 3;
	}
	printf("%d", a);
	return 0;
}